#ifndef _BSP_PARAM_H
#define _BSP_PARAM_H
#include <stdio.h>
#include <string.h>
#define FIRMWARE_VERSION "0_official_V1.0.1"
#define OTA_FIRMWARE_VERSION "V1.0.1"
#define VERTYPE "official"
#define HWVER   "A"
/* MQTT连接 */
enum{
    MQTT_DISCONNECT = 0, 
    MQTT_APP_DISCONNECT = 0,
    MQTT_CONNECT = 1,
    MQTT_APP_CONNECT = 1,
    MQTT_CONNECT_PRIORITY_H = 2,
};

/* BLUFI连接 */
enum{
    BLUFI_BLE_DISCONNECT = 0,
    BLUFI_BLE_CONNECT = 1,
    BLE_CONNECT_PRIORITY_H = 2,
};

/* 档位强度 */
enum{
    STRENGTH_L = 1,         // 低档位
    STRENGTH_H = 3,             // 高档位
    STRENGTH_MAX,             
};
/* 系统状态 */
enum{
    SYS_PAUSE = 0,
    SYS_STOP,
    SYS_RUN_NORMAL,
    SYS_RUN_FREQCHANGE,
    SYS_RUN_HIGHTEMP,
};
/* 发送状态 */
enum{
    SEND_STATUS_STOP = 0,
    SEND_STATUS_RUN,
    SEND_STATUS_PAUSE,
};

/* 虚实 */
enum{
    MODE_SHI = 1,
    MODE_XU,
    MODE_MAX,
};
/* 错误类型 */
enum{
    ERROR_TYPE_NO_ERROR = 0,
    ERROR_TYPE_TEMP_HIGH = 0X01,
    ERROR_TYPE_TEMP_LOW = 0X02,
    ERROR_TYPE_NTC_DISCONNECT = 0X04,
};
/* 发送mqtt 对象 */
enum{
    /* D2S */
    MQTT_SEND_D2S_QD = 0,   // 签到
    MQTT_SEND_D2S_GJ,       // 固件版本获取
    MQTT_SEND_D2S_ACK,      // 应答
    /* D2U */
    MQTT_SEND_D2U_ZT,       // 状态上报
    MQTT_SEND_D2U_ACK,      // ACK
    MQTT_SEND_D2U_OTA,      // OTA状态上报

};
/* ota */
enum{
    OTA_IDLE = 0, 
    OTA_REC_REQ = 1,
    OTA_START,
    OTA_SUCCESS,
    OTA_FAIL,
};

typedef struct  
{
    uint8_t sys_status;
    uint8_t sys_strength;
    uint8_t sys_mode;
    uint8_t systemp[3];             // 温度
    uint8_t sys_error_type;
    uint8_t ifappmqttconnect;       // 手机app是否发送START 表示app也连接上mqtt
    uint8_t ifblufibleconnect;      // 手机app是否连接blufi ble蓝牙
    
    uint16_t sys_runtime;
    uint16_t sys_countdown;
}sys_main_param_t;


typedef struct  
{
    uint8_t send_status;
    uint8_t send_strength;
    uint8_t send_mode;
    uint8_t send_error_type;
    uint8_t send_temp;
    uint16_t send_runtime;
    uint16_t send_countdown;
}send_param_t;





extern char ota_firm_ver_url[100];
extern uint8_t ota_req_flag;



void* Get_sys_param_pos(void);
void* Get_send_param_pos(void);








#endif


